#include "Assignable.h"

Assignable::Assignable(JassType * type_) : type(type_) {}

void Assignable::setValue(JassValue* value_) {
    //if (value_ == nullptr) {
    //    if (!type->isNullable()) {
    //        throw std::runtime_error("Type " + type->getName() + " cannot be assigned to null!");
    //    }
    //    this->value = type->getNullValue();
    //}
    //else {
    //    JassType* valueType = value_->visit(JassTypeGettingValueVisitor());
    //    if (!type->isAssignableFrom(valueType)) {
    //        throw std::runtime_error("Incompatible types " + valueType->getName() + " != " + type->getName());
    //    }
    //    this->value = value_;
    //}
}